﻿/*
* ========================================================================
* 类说明：
*   
* 
* 作者：HGS   时间：2024/12/25 17:14:12
* 
* 修改者：         时间：           
* 修改说明：
* ========================================================================
*/

using HGSTestLibrary.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VM.Shared.TestAttribute;

namespace HGSTestLibrary
{
    public class 弹窗工具
    {
        [ExposedMethodAttribute("")]
        public bool 震动弹窗(int 测试时长,out string[] 电流值列表,out bool[] 屏幕测试列表,out string 错误消息)
        {
            错误消息 = string.Empty;
            电流值列表 = new string[0];
            屏幕测试列表 = new bool[0];
            try
            {
                bool result = false;
                Application.Current.Dispatcher.Invoke(() =>
                {
                    var uc = new 震动测试();
                    Window win = new Window()
                    {
                        WindowStyle = WindowStyle.None,
                        ResizeMode = ResizeMode.NoResize,
                        WindowStartupLocation = WindowStartupLocation.CenterScreen,
                        Width = uc.Width,
                        Height = uc.Height,
                    };
                    win.Content = uc;
                    var ret = win.ShowDialog();
                    result = uc.DialogResult;
                });

                return result;
            }
            catch (Exception ex)
            {
                错误消息 = ex.Message;
            }
            return false;
        }
    }
}
